package homework;

import java.util.TreeSet;
@SuppressWarnings({"all"})

public class HomeWork05 {
    public static void main(String[] args) {
        TreeSet treeSet = new TreeSet();

        treeSet.add(new Person());
        treeSet.add(new Person());
        treeSet.add(new Person());
        treeSet.add(new Person());
        treeSet.add(new Person());
        System.out.println(treeSet);
        //add方法，因为TreeSet()构造器没有传入Comparator接口的匿名内部类
        //在底层(Comparable<? super K>)k1).compareTo((K)k2)
        //把Person转成Comparable类型
    }
}

class Person implements Comparable{

    @Override
    public int compareTo(Object o) {
        return 0;
    }
}